package 力扣._739_每日温度;

public class Solution {
    public int[] dailyTemperatures(int[] temperatures) {
//        Stack<Integer> stack = new Stack<>();
        int[] list = new int[temperatures.length];
        //先暴力一个
        for (int i = 0; i < temperatures.length; i++) {
            int d = 1;
            while (i + d < temperatures.length && temperatures[i] > temperatures[i + d]) d++;
            if (i + d == temperatures.length)
                list[i] = 0;
            else
                list[i] = d;
        }
        return list;
    }

}
